Skip to content

feat: support DeepSeek V4 THD packing#1766

Open
samaritan1998 wants to merge 2 commits into
radixark:mainfrom
samaritan1998:zmm/deepseek-v4-thd-pack-main-0722
Open

feat: support DeepSeek V4 THD packing#1766
samaritan1998 wants to merge 2 commits into
radixark:mainfrom
samaritan1998:zmm/deepseek-v4-thd-pack-main-0722

Conversation

@samaritan1998

@samaritan1998 samaritan1998 commented Jul 22, 2026

Copy link
Copy Markdown

Summary

  • Add true THD packing for DeepSeek-V4 with sample-local cu_seqlens boundaries.
  • Keep CP all-gather, DSV4 window/compressed attention, compressor overlap, RoPE, and TileLang indexer paths boundary-safe.
  • Propagate per-sample padded lengths through response extraction, CP loss masks, log-probs, entropy, and DeepSeek-V4 assistant-only loss masking.
  • Add focused packing, CP-boundary, compressor, indexer-workspace, padding-alignment, and loss-mask tests.

Validation

  • Core packing revision in the target image: 7 passed, 30 warnings.
  • Current rebased head 8ee08fe8: Python compileall, git diff --check, conflict-signature checks, and explicit diff review passed. The rebase only integrated upstream OPD/teacher-log-prob slicing and prompt-filter refactors in two conflict sites.
  • Packing mechanics smoke: 16 nodes / 128 GPUs, 128K THD all-gather CP (TP4 / PP16 / CP2 / EP8, MBS2 / GBS2) reached Succeeded, train/loss=0.1330631522475227, and train/grad_norm=1.013722736354215.
  • Checkpoint caveat: that smoke used a legacy local DeepSeekV4-pro -> FP4Unpacked -> torch_dist chain. It did not use the explicitly requested official deepseek-ai/DeepSeek-V4-Pro-Base repository, so it validates the packing path only and is not the final official-Pro-Base acceptance run.
  • Official DeepSeek-V4-Pro-Base end-to-end rerun is pending conversion/loading validation.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@samaritan1998
samaritan1998 force-pushed the zmm/deepseek-v4-thd-pack-main-0722 branch from df62a86 to 8ee08fe Compare July 25, 2026 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant